home *** CD-ROM | disk | FTP | other *** search
- ;======================================================================
- ; INT 14H is IBM PC's BIOS Comm I/O Interrupt. The following is
- ; excerpted from "Assembler for the IBM PC and PC-XT" by Peter Abel.
- ;======================================================================
- ; Int 14H: Communications Input/Output. This operation provides byte
- ; stream I/O to the RS232 communications port. The DX should contain
- ; number of the RS232 adapter (0 or 1). There are four calls established
- ; through the AH register.
- ; .
- ; .
- ; .
- ; AH = 03: Return the status of the communications port. The operation
- ; sets the AH with the line control status and sets the AL with
- ; the modem status.
- ; AH = line control status AL = modem status
- ; 7 = Time out Recieved line signal detect
- ; 6 = Trans dhift register empty Ring indicator
- ; 5 = Trans hold register empty Data set ready
- ; 4 = Break detect Clear to send
- ; 3 = Framing error Delta receive line signal detect
- ; 2 = Parity error Trailing edge ring detector
- ; 1 = Overrun error Delta data set ready
- ; 0 = Data ready Delta clear to send
- ;
- ;The following ASM code will check the modem for Clear-To-Send
- CHECK_COMM:
- MOV DX,0 ; We're gonna check COM1
- MOV AH,3 ; Request comm port status
- INT 14H ; Call to BIOS
- CMP AL,4 ; Is "Clear To Send" a character
- JE SEND_CHAR ; Do it.
- JMP CHECK_COMM ; Not yet check it again
- ; You may want to do somthing else here
- ;
- SEND_CHAR: ; Note that option 2 for INT 14H will also
- ; set AL and AH as in option 3 above
- MOV DX,0 ; Redundant but why not
- MOV AL,byte ptr [SI] ; Assuming SI points to the byte to send
- MOV AH,2 ; Request send char
- INT 14H ; Call to BIOS
- AND AH,128 ; Bit 7 set if unsuccessfull
- CMP AH,0 ;
- JE SEND_ERR ; Jump to error recovery code
- INC SI ; Point to next byte to send
- ; You'll need to add code here to get out
- CMP AL,4 ; Is "Clear To Send" a character
- JE SEND_CHAR ; Do it.
- JMP CHECK_COMM ; Not yet check it again
- ;
- ; This is untested, but should work, mjd.
- SEND_CHAR ; Do it.
- JMP CHECK_COMM ; Not yet check it again
- ;
- ; This is untested, but should